gail: don't try to get stock id from images that aren't stock
authorWilliam Jon McCann <jmccann@redhat.com>
Thu, 7 Oct 2010 06:48:20 +0000 (02:48 -0400)
committerWilliam Jon McCann <jmccann@redhat.com>
Thu, 7 Oct 2010 06:52:35 +0000 (02:52 -0400)
Fixes assertion caused by 41d2a4d059d881d8d05419013ae4946a81b308cb

modules/other/gail/gailimage.c

index 38d0c587c7a0dc68476a458a90576c76c49618d6..da8698551d08bf3bbaaab50235ca56b9a67a2e62 100644 (file)
@@ -146,9 +146,11 @@ gail_image_get_name (AtkObject *accessible)
   g_free (image_accessible->stock_name);
   image_accessible->stock_name = NULL;
 
+  if (gtk_image_get_storage_type (image) != GTK_IMAGE_STOCK)
+    return NULL;
+
   gtk_image_get_stock (image, &stock_id, NULL);
-  if (gtk_image_get_storage_type (image) != GTK_IMAGE_STOCK ||
-      stock_id == NULL)
+  if (stock_id == NULL)
     return NULL;
 
   if (!gtk_stock_lookup (stock_id, &stock_item))